package demo1;
class Shape {
    public void draw() {
        System.out.println("画图形！");
    }
}
class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画○");
    }
}
class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形");
    }
}
class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画△");
    }
}
class Flower extends Shape {
    public void draw() {
        System.out.println("画❀");
    }
}
public class Test {
    public static void func(Shape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
        func(new Rect());
        func(new Triangle());
        func(new Cycle());
        func(new Flower());
    }
}
